<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
</html>
<script>
	//求1! + 2! + 3! + 4! + …… + 10!的和
	//先分柝，写一个阶乘的函数
	function jiechenhe(a){
		var sum = 1;
		for(var i = 1; i <= a; i++){
			sum *= i;
		};
		//每次调用的时候得到一个结果
		return sum;
	};
	
	//求和
	var he = 0;
	for(var j = 1; j <= 10; j++){
		he += jiechenhe(j);
	};
	console.log(he);
</script>
